﻿using System;
using System.Collections.Generic;

namespace CAION2.Classes
{
    internal static class ClassEnchantment
    {
        internal class EnchantValues
        {
            internal readonly SByte PhysicalDefend;
            internal readonly SByte Hp;
            internal readonly SByte PhysicalCriticalReduceRate;
            internal readonly SByte MainHandAttack;
            internal readonly SByte MagicalSkillBoost;
            internal readonly SByte DamageReduce;
            internal readonly SByte Block;
            internal readonly SByte MagicalBlock;

            internal EnchantValues(SByte pd, SByte hp, SByte pdr, SByte mb)
            {
                PhysicalDefend = pd;
                Hp = hp;
                PhysicalCriticalReduceRate = pdr;
                MagicalBlock = mb;
            }

            internal EnchantValues(SByte mha, SByte msb)
            {
                MainHandAttack = mha;
                MagicalSkillBoost = msb;
            }

            internal EnchantValues(bool shield, SByte dr, SByte b)
            {
                if (!shield) return;

                DamageReduce = dr;
                Block = b;
            }

        }

        internal static readonly IDictionary<String, EnchantValues> PlateEnchant = new Dictionary<string, EnchantValues>();
        internal static readonly IDictionary<String, EnchantValues> ChainEnchant = new Dictionary<string, EnchantValues>();
        internal static readonly IDictionary<String, EnchantValues> LeatherEnchant = new Dictionary<string, EnchantValues>();
        internal static readonly IDictionary<String, EnchantValues> RobeEnchant = new Dictionary<string, EnchantValues>();

        internal static readonly IDictionary<String, EnchantValues> WeaponEnchant = new Dictionary<string, EnchantValues>();
        internal static readonly IDictionary<String, EnchantValues> ShieldEnchant = new Dictionary<string, EnchantValues>();

        //0 - одежда
        //1 - оружие
        internal enum EnchantSlots
        {
            main_or_sub = 1,
            main = 1,
            torso = 0,
            glove = 0,
            leg = 0,
            foot = 0,
            sub = 1,
            shoulder = 0
        }

        static ClassEnchantment()
        {
            PlateEnchant.Add("torso", new EnchantValues(6, 8, 4, 3));
            PlateEnchant.Add("leg", new EnchantValues(5, 6, 3, 2));
            PlateEnchant.Add("foot", new EnchantValues(4, 4, 2, 2));
            PlateEnchant.Add("shoulder", new EnchantValues(4, 4, 2, 2));
            PlateEnchant.Add("glove", new EnchantValues(4, 4, 2, 2));

            ChainEnchant.Add("torso", new EnchantValues(5, 10, 4, 3));
            ChainEnchant.Add("leg", new EnchantValues(4, 8, 3, 2));
            ChainEnchant.Add("foot", new EnchantValues(3, 6, 2, 2));
            ChainEnchant.Add("shoulder", new EnchantValues(3, 6, 2, 2));
            ChainEnchant.Add("glove", new EnchantValues(3, 6, 2, 2));

            LeatherEnchant.Add("torso", new EnchantValues(4, 12, 4, 3));
            LeatherEnchant.Add("leg", new EnchantValues(3, 10, 3, 2));
            LeatherEnchant.Add("foot", new EnchantValues(2, 8, 2, 2));
            LeatherEnchant.Add("shoulder", new EnchantValues(2, 8, 2, 2));
            LeatherEnchant.Add("glove", new EnchantValues(2, 8, 2, 2));

            RobeEnchant.Add("torso", new EnchantValues(3, 14, 4, 3));
            RobeEnchant.Add("leg", new EnchantValues(2, 12, 3, 2));
            RobeEnchant.Add("foot", new EnchantValues(1, 10, 2, 2));
            RobeEnchant.Add("shoulder", new EnchantValues(1, 10, 2, 2));
            RobeEnchant.Add("glove", new EnchantValues(1, 10, 2, 2));

            WeaponEnchant.Add("1h_sword", new EnchantValues(2, 0));
            WeaponEnchant.Add("2h_sword", new EnchantValues(4, 0));
            WeaponEnchant.Add("2h_polearm", new EnchantValues(4, 0));
            WeaponEnchant.Add("1h_dagger", new EnchantValues(2, 0));
            WeaponEnchant.Add("bow", new EnchantValues(4, 0));
            WeaponEnchant.Add("2h_book", new EnchantValues(4, 20));
            WeaponEnchant.Add("2h_orb", new EnchantValues(4, 20));
            WeaponEnchant.Add("2h_staff", new EnchantValues(3, 20));
            WeaponEnchant.Add("1h_mace", new EnchantValues(3, 20));
            WeaponEnchant.Add("2h_cannon", new EnchantValues(4, 0));
            WeaponEnchant.Add("1h_gun", new EnchantValues(2, 0));
            WeaponEnchant.Add("2h_harp", new EnchantValues(3, 20));
            WeaponEnchant.Add("2h_keyblade", new EnchantValues(4, 20));
            
            ShieldEnchant.Add("shield", new EnchantValues(true, 2, 30));
        }
    }
}
